package _6_Struct._6_1_Adptor.dynamicImpl;

/**
 * 适配器，实现了目标接口，适配了新需求，Adaptee不用更改，符合开闭原则
 * 将请求委派给原类Adaptee
 */
public class Adaptor implements Target {
    private Adaptee adaptee;

    public Adaptor(Adaptee adaptee) {
        this.adaptee = adaptee;
    }

    @Override
    public void operation1() {
        adaptee.operation1();
    }

    @Override
    public void operation2() {
        System.out.println("adaptor operation2");
    }
}
